-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Synthtrace] Adding Entities support #196258
[Synthtrace] Adding Entities support #196258
Conversation
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
if (timestamp) { | ||
const isoString = new Date(timestamp).toISOString(); | ||
document['entity.lastSeenTimestamp'] = isoString; | ||
document['event.ingested'] = isoString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]: Do you always want to override this field ? Or only when its not present ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always want to override it.
} | ||
} | ||
|
||
async uninstallEntityIndexPatterns() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but tests could use it after
they run.
packages/kbn-apm-synthtrace/src/lib/apm/client/entities_synthtrace_kibana_client.ts
Show resolved
Hide resolved
syntheticsEsClient, | ||
otelEsClient, | ||
entitiesEsClient, | ||
entitiesKibanaClient, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the kibana client here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntheticsEsClient, | ||
otelEsClient, | ||
entitiesEsClient, | ||
entitiesKibanaClient, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, is kibana client needed for the entities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just added some questions, for me to understand
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
History
|
Starting backport for target branches: 8.17, 8.x |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## known issue ``` - Transforms are not started by synthtrace. Because it duplicates data ingested by synthrace on signal indices. And it takes a long time to generate data. - We are not able to open the Inventory page because of 👆🏻. ``` --- ``` node scripts/synthtrace.js traces_logs_entities.ts --clean --live ``` or ``` node scripts/synthtrace.js traces_logs_entities.ts --clean --from=2024-04-08T08:00:00.000Z --to=2024-04-08T08:15:00.000Z ``` docs produces by the new scenario: ``` { "took": 1, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 3, "relation": "eq" }, "max_score": 1, "hits": [ { "_index": ".entities.v1.latest.builtin_services_from_ecs_data", "_id": "2846700000000001", "_score": 1, "_source": { "service": { "name": "synth-node-trace-logs", "environment": "Synthtrace: traces_logs_entities" }, "source_data_stream": { "type": [ "traces", "logs" ] }, "agent": { "name": [ "nodejs" ] }, "entity": { "id": "2846700000000001", "type": "service", "definitionId": "latest", "lastSeenTimestamp": "2024-10-15T08:56:20.562Z" }, "event": { "ingested": "2024-10-15T08:56:20.562Z" } } }, { "_index": ".entities.v1.latest.builtin_services_from_ecs_data", "_id": "2846700000000000", "_score": 1, "_source": { "service": { "name": "synth-java-trace", "environment": "Synthtrace: traces_logs_entities" }, "source_data_stream": { "type": [ "traces" ] }, "agent": { "name": [ "java" ] }, "entity": { "id": "2846700000000000", "type": "service", "definitionId": "latest", "lastSeenTimestamp": "2024-10-15T08:56:20.562Z" }, "event": { "ingested": "2024-10-15T08:56:20.562Z" } } }, { "_index": ".entities.v1.latest.builtin_services_from_ecs_data", "_id": "2846700000000002", "_score": 1, "_source": { "service": { "name": "synth-go-logs", "environment": "Synthtrace: traces_logs_entities" }, "source_data_stream": { "type": [ "logs" ] }, "agent": { "name": [ "go" ] }, "entity": { "id": "2846700000000002", "type": "service", "definitionId": "latest", "lastSeenTimestamp": "2024-10-15T08:56:20.562Z" }, "event": { "ingested": "2024-10-15T08:56:20.562Z" } } } ] } } ``` (cherry picked from commit fe22ac9) # Conflicts: # packages/kbn-apm-synthtrace-client/index.ts # packages/kbn-apm-synthtrace/src/cli/scenario.ts # packages/kbn-apm-synthtrace/src/cli/utils/bootstrap.ts # packages/kbn-apm-synthtrace/src/cli/utils/start_live_data_upload.ts # packages/kbn-apm-synthtrace/src/cli/utils/synthtrace_worker.ts
# Backport This will backport the following commits from `main` to `8.x`: - [[Synthtrace] Adding Entities support (#196258)](#196258) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cauê Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T15:21:32Z","message":"[Synthtrace] Adding Entities support (#196258)\n\n## known issue\r\n```\r\n- Transforms are not started by synthtrace. \r\nBecause it duplicates data ingested by synthrace on signal indices. And it takes a long time to generate data.\r\n\r\n- We are not able to open the Inventory page because of 👆🏻.\r\n```\r\n---\r\n\r\n```\r\nnode scripts/synthtrace.js traces_logs_entities.ts --clean --live\r\n```\r\nor \r\n```\r\nnode scripts/synthtrace.js traces_logs_entities.ts --clean --from=2024-04-08T08:00:00.000Z --to=2024-04-08T08:15:00.000Z\r\n```\r\n\r\ndocs produces by the new scenario:\r\n```\r\n{\r\n \"took\": 1,\r\n \"timed_out\": false,\r\n \"_shards\": {\r\n \"total\": 1,\r\n \"successful\": 1,\r\n \"skipped\": 0,\r\n \"failed\": 0\r\n },\r\n \"hits\": {\r\n \"total\": {\r\n \"value\": 3,\r\n \"relation\": \"eq\"\r\n },\r\n \"max_score\": 1,\r\n \"hits\": [\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000001\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-node-trace-logs\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"traces\",\r\n \"logs\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"nodejs\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000001\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n },\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000000\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-java-trace\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"traces\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"java\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000000\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n },\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000002\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-go-logs\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"logs\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"go\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000002\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n}\r\n```","sha":"fe22ac99281c9750e9dd55b16fc3ca284ba7683c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.17.0"],"number":196258,"url":"https://github.com/elastic/kibana/pull/196258","mergeCommit":{"message":"[Synthtrace] Adding Entities support (#196258)\n\n## known issue\r\n```\r\n- Transforms are not started by synthtrace. \r\nBecause it duplicates data ingested by synthrace on signal indices. And it takes a long time to generate data.\r\n\r\n- We are not able to open the Inventory page because of 👆🏻.\r\n```\r\n---\r\n\r\n```\r\nnode scripts/synthtrace.js traces_logs_entities.ts --clean --live\r\n```\r\nor \r\n```\r\nnode scripts/synthtrace.js traces_logs_entities.ts --clean --from=2024-04-08T08:00:00.000Z --to=2024-04-08T08:15:00.000Z\r\n```\r\n\r\ndocs produces by the new scenario:\r\n```\r\n{\r\n \"took\": 1,\r\n \"timed_out\": false,\r\n \"_shards\": {\r\n \"total\": 1,\r\n \"successful\": 1,\r\n \"skipped\": 0,\r\n \"failed\": 0\r\n },\r\n \"hits\": {\r\n \"total\": {\r\n \"value\": 3,\r\n \"relation\": \"eq\"\r\n },\r\n \"max_score\": 1,\r\n \"hits\": [\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000001\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-node-trace-logs\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"traces\",\r\n \"logs\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"nodejs\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000001\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n },\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000000\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-java-trace\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"traces\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"java\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000000\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n },\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000002\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-go-logs\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"logs\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"go\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000002\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n}\r\n```","sha":"fe22ac99281c9750e9dd55b16fc3ca284ba7683c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196258","number":196258,"mergeCommit":{"message":"[Synthtrace] Adding Entities support (#196258)\n\n## known issue\r\n```\r\n- Transforms are not started by synthtrace. \r\nBecause it duplicates data ingested by synthrace on signal indices. And it takes a long time to generate data.\r\n\r\n- We are not able to open the Inventory page because of 👆🏻.\r\n```\r\n---\r\n\r\n```\r\nnode scripts/synthtrace.js traces_logs_entities.ts --clean --live\r\n```\r\nor \r\n```\r\nnode scripts/synthtrace.js traces_logs_entities.ts --clean --from=2024-04-08T08:00:00.000Z --to=2024-04-08T08:15:00.000Z\r\n```\r\n\r\ndocs produces by the new scenario:\r\n```\r\n{\r\n \"took\": 1,\r\n \"timed_out\": false,\r\n \"_shards\": {\r\n \"total\": 1,\r\n \"successful\": 1,\r\n \"skipped\": 0,\r\n \"failed\": 0\r\n },\r\n \"hits\": {\r\n \"total\": {\r\n \"value\": 3,\r\n \"relation\": \"eq\"\r\n },\r\n \"max_score\": 1,\r\n \"hits\": [\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000001\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-node-trace-logs\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"traces\",\r\n \"logs\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"nodejs\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000001\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n },\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000000\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-java-trace\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"traces\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"java\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000000\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n },\r\n {\r\n \"_index\": \".entities.v1.latest.builtin_services_from_ecs_data\",\r\n \"_id\": \"2846700000000002\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"service\": {\r\n \"name\": \"synth-go-logs\",\r\n \"environment\": \"Synthtrace: traces_logs_entities\"\r\n },\r\n \"source_data_stream\": {\r\n \"type\": [\r\n \"logs\"\r\n ]\r\n },\r\n \"agent\": {\r\n \"name\": [\r\n \"go\"\r\n ]\r\n },\r\n \"entity\": {\r\n \"id\": \"2846700000000002\",\r\n \"type\": \"service\",\r\n \"definitionId\": \"latest\",\r\n \"lastSeenTimestamp\": \"2024-10-15T08:56:20.562Z\"\r\n },\r\n \"event\": {\r\n \"ingested\": \"2024-10-15T08:56:20.562Z\"\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n}\r\n```","sha":"fe22ac99281c9750e9dd55b16fc3ca284ba7683c"}},{"branch":"8.17","label":"v8.17.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
known issue
or
docs produces by the new scenario: